package com.carleasoft.mps.adu.business.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.carleasoft.mps.adu.business.user.bean.entity.AuthorityUserPositionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>Description: userPosition dao</p>
 * @since 2020-05-09
 * @author ztm
 */
@Repository
@Mapper
public interface AuthorityUserPositionDao extends BaseMapper<AuthorityUserPositionEntity> {

    /**
     * 添加用户职位关系信息
     * @param authorityUserPositionEntities
     * @return int
     */
    int batchAddUserPosition(@Param("authorityUserPositionEntities") List<AuthorityUserPositionEntity> authorityUserPositionEntities);

    /**
     * 删除用户职位关系信息
     * @param userCode
     * @return int
     */
    int deleteUserPosition(String userCode);

    /**
     * 通过用户编码查询职位集合
     * @param userCode
     * @return List<String>
     */
    List<AuthorityUserPositionEntity> selectPositionByUserCode(String userCode);

    /**
     * 通过职位编码查询用户编码集合
     * @param positionCode
     * @return List<String>
     */
    List<String> selectUserCodesByPositionCode(@Param("positionCode") String positionCode);
}
